#!/bin/bash

#
# afxrdstage -- by Dario Berzano <dario.berzano@gmail.com>
#
# This file is part of afdsmgrd -- see http://code.google.com/p/afdsmgrd
#
# A simple wrapper around xrdstagetool that removes anchor from file. Note that
# xrdstagetool must be located in PATH.
#

if [[ "$1" =~ (^root:[^#]*) ]]; then
  shift
  xrdstagetool "$@" "${BASH_REMATCH[1]}"
else
  echo "FAIL $1"
fi
